from flask import Flask,request


app = Flask(__name__)

# 服务区接受参数
# 定义方法

@app.route("/hello/<user>")
def hello(user):
    print(type(user))
    return f"hello,{user}"

@app.route("/book/<int:id>")
def findbook(id):
    print(type(id))
    return f"id is{id}"

@app.route("/user/add",methods=["get","port"])
def add_user():
    age=request.args.get(key="age",default=18,type=int)
    return f"您的年龄是{age}"

if __name__ == '__main__':
    app.run()